﻿package com.game.module.semiInterface
{
	import com.game.event.GameEvent;
	import com.game.manager.NotificationManager;
	
	import config.Config;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.*;
	
	public class FutureBoat extends Sprite
	{
		
		public function FutureBoat()
		{
			super();
			this.gc = Config.getIns();
			this.addEventListener(Event.ADDED_TO_STAGE, this.added, false, 0, true);
			this.addEventListener(Event.REMOVED_FROM_STAGE, this.removed, false, 0, true);
		}
		
		public var btn_close:SimpleButton;
		public var mssd:SimpleButton;
		public var qysk:SimpleButton;
		public var bzs:SimpleButton;
		public var hss:SimpleButton;
		private var levelList:Array = ["mssd", "qysk", "bzs", "hss"];
		private var gc:Config;
		
		private function destroy():void
		{
			if (this.parent)
			{
				this.parent.removeChild(this);
			}
		}
		
		private function added(param1:Event):void
		{
			for each(var _loc1_:String in this.levelList)
			{
				(this[_loc1_] as SimpleButton).addEventListener(MouseEvent.CLICK, (this["into" + _loc1_] as Function))
			}
			this.btn_close.addEventListener(MouseEvent.CLICK, this.closeui);
		}
		
		private function removed(param1:Event):void
		{
			for each(var _loc1_:String in this.levelList)
			{
				(this[_loc1_] as SimpleButton).removeEventListener(MouseEvent.CLICK, (this["into" + _loc1_] as Function))
			}
			this.btn_close.removeEventListener(MouseEvent.CLICK, this.closeui);
		}
		
		private function intobzs(param1:MouseEvent):void
		{
			if (this.gc.playerData.level < 40)
			{
				NotificationManager.alert("等级未到40级，无法挑战！");
				return;
			}
			this.gc.curStage = 16;
			this.gc.curLevel = 1;
			
			this.destroy();
		}
		
		private function intohss(param1:MouseEvent):void
		{
			if (this.gc.playerData.level < 40)
			{
				NotificationManager.alert("等级未到40级，无法挑战！");
				return;
			}
			this.gc.curStage = 30;
			this.gc.curLevel = 1;
			
			this.destroy();
		}
		
		private function intomssd(param1:MouseEvent):void
		{
			if (this.gc.playerData.level < 40)
			{
				NotificationManager.alert("等级未到40级，无法挑战！");
				return;
			}
			this.gc.curStage = 13;
			this.gc.curLevel = 1;
			
			this.destroy();
		}
		
		private function intoqysk(param1:MouseEvent):void
		{
			if (this.gc.playerData.level < 40)
			{
				NotificationManager.alert("等级未到40级，无法挑战！");
				return;
			}
			this.gc.curStage = 15;
			this.gc.curLevel = 1;
			
			this.destroy();
		}
		
		private function closeui(param1:MouseEvent):void
		{
			this.destroy();
		}
	}
}
